package com.loong.data.service.impl;

import com.loong.common.dubbo.service.AbstractService;
import com.loong.common.rest.rpc.RPCResponse;
import com.loong.data.dto.GoodsDTOResult;
import com.loong.data.handler.GoodsHandler;
import com.loong.data.service.IGoodsService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:
 * @Author: 刘群
 * @Date: 2020/11/17 17:41
 */
@DubboService(timeout = 5000,interfaceClass = IGoodsService.class)
public class GoodsServiceImpl extends AbstractService implements IGoodsService {

    @Resource
    private GoodsHandler goodsHandler;

    @Override
    public RPCResponse<List<GoodsDTOResult>> findGoodsByIds(List<Long> idList) {
        return serviceExecutor.execute(() -> goodsHandler.findGoodsByIds(idList));
    }

    @Override
    public RPCResponse<GoodsDTOResult> findGoodsBySkuId(Long skuId) {
        return serviceExecutor.execute(() -> goodsHandler.findGoodsBySkuId(skuId));
    }
}
